from django.db import models

# Create your models here.

class reader(models.Model):
    name=models.CharField(max_length=100)
    password=models.CharField(max_length=100)
    email=models.CharField(max_length=100)

class publisher(models.Model):
    name=models.CharField(max_length=100,unique=True)
    address=models.CharField(max_length=100)

class book(models.Model):
    name      =models.CharField(max_length=100)
    publisher   =models.ForeignKey(publisher,on_delete=models.CASCADE,related_name='books')
    status     =models.IntegerField(default=0)
    reader      =models.CharField(max_length=100,null=True)
    updatetime   =models.DateTimeField(auto_now_add=True)



